package jannex.sql;

import jannex.JannexException;

import java.sql.Array;
import java.util.Map;

public interface JxArray extends Array, AutoCloseable {


    <E> TypedArray<E> as(Class<E> elementClass) throws JannexException;

    @Override
    String getBaseTypeName() throws JannexException;

    @Override
    int getBaseType() throws JannexException;

    @Override
    Object getArray() throws JannexException;

    @Override
    Object getArray(Map<String, Class<?>> map) throws JannexException;

    @Override
    Object getArray(long index, int count) throws JannexException;

    @Override
    Object getArray(long index, int count, Map<String, Class<?>> map) throws JannexException;

    @Override
    JxResultSet getResultSet() throws JannexException;

    @Override
    JxResultSet getResultSet(Map<String, Class<?>> map) throws JannexException;

    @Override
    JxResultSet getResultSet(long index, int count) throws JannexException;

    @Override
    JxResultSet getResultSet(long index, int count, Map<String, Class<?>> map) throws JannexException;

    @Override
    void free() throws JannexException;

    @Override
    default void close() {
        free();
    }
}